<template>
  <div>
    <component :is="activity" :type="type" @change="changeComponent"></component>
  </div>
</template>

<script>
import List from './list.vue'
import Form from './form.vue'
export default {
  components: {
    List,
    Form
  },
  data() {
    return {
      activity: 'List',
      type: '新增'
    };
  },
  methods: {
    changeComponent(str, type) {
      this.type = type
      this.$nextTick(() => {
        this.activity = str
      })
    }
  }
};
</script>
